class ControllerService {

    constructor(parent) {
        this.parent = parent;
    }
    @Midway.FixPropertyConfig({enumerable: true})
    getInterfaceMethods() {
        return [{
            name: "ITimer",
            methods: ['initTimeValue', 'setTimeValue']
        }, {
            name: "ITimerOver",
            methods: ['onTimeOver']
        }];
    }
    @Midway.FixPropertyConfig({enumerable: true})
    beforePresenterRun(name, metaInfo, service) {
        this.parent.services[name].push(service);
    }
}

class TimerControllerService {
    constructor(parent) {
        this.parent = parent;
    }

    //开始计时
    start(isUseModel, startTime) {
        this.parent._start(isUseModel, startTime);
    }

    //暂停计时
    pause(isStopTime) {
        this.parent._pause(isStopTime);
    }

    //停止计时
    stop() {
        this.parent._stop();
    }

    //设置当前计时器
    // setTimeValue: function(second) {

    // },
    //获取当前计时
    getTimeValue() {
        return this.parent.spendSecond;
    }
}

export {ControllerService, TimerControllerService};